﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<script type="text/javascript">
	function checkText(){
            var textValue = document.getElementById("name").value;
            if(textValue == ""){
                alert("输入框不能为空！");
	return false;
            }
        }
</script>
</head>

<body>
	<form action="add" method="post">
		<div align="center">
			<table>
				<tr>
					<td>书名：<input type="text" name="bookName" id="name"/></td>
					<td>作者：<input type="text" name="bookAuthor" /></td>
					<td>出版社：<input type="text" name="bookPublish" /></td>
					<td>页数：<input type="text" name="bookPage" /></td>
					<td>价格：<input type="text" name="bookPrice" /></td>
					<td><input type="submit" value="提交" onblur="return  checkText();"/><input type="reset"
						value="重置" /></td>
				</tr>
			</table>
		</div>
	</form>
</body>
</html>
